﻿Public Class GetImage
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        'Create a CAPTCHA image using the text stored in the Session object.
        If Session("CaptchaImageText") Is Nothing = False Then
            Dim ci As New CaptchaImage.CaptchaImage(Me.Session("CaptchaImageText"), 200, 50, "Century Schoolbook")
            'Session("Captcha") = ci
            Me.Response.Clear()
            Me.Response.ContentType = "image/jpeg"

            ci.Image.Save(Me.Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg)
            ci.Dispose()
        End If
    End Sub

End Class